extends Area


# Declare member variables here. Examples:
# var a = 2
# var b = "text"


# Called when the node enters the scene tree for the first time.
func _ready():
	pass # Replace with function body.
func _on_Area_body_entered(body):
	if body.name=="player":
		Global.level+=1
		if Global.level==2:
# warning-ignore:return_value_discarded
			get_tree().change_scene("res://scene/level2.tscn")
		if Global.level==3:
# warning-ignore:return_value_discarded
			get_tree().change_scene("res://scene/level3.tscn")
		if Global.level==4:
# warning-ignore:return_value_discarded
			get_tree().change_scene("res://scene/level4.tscn")
		if Global.level==5:
# warning-ignore:return_value_discarded
			get_tree().change_scene("res://scene/win.tscn")
	pass # Replace with function body.
